package com.founder.gateway.system.bean;

import org.setu.framework.session.AbStractSetuSession;

public class SetuSession extends AbStractSetuSession {
    private static final String USERNAME = "userName";
    private static final String INDUSTRIALID = "industrialid";
    private static final String USERORGCODE = "userOrgCode";
    private static final String USERORGNAME = "userOrgName";
    private static final String SSDSJCODE = "ssDsjCode";
    private static final String SSFSXCODE = "ssFsxCode";
    private static final String SSPCSCODE = "ssPcsCode";
    /**
     * 不会被序列化
     */
    private transient String apiSchemeId;
    private transient String appId;
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    public String remoteIp;

    @Override
    public String getShardingFlag() {
        return String.valueOf(getUserId().hashCode());
    }

    @Override
    public String getUserId() {
        return (String) getAttribute(USERID);
    }

    public void setUserId(String userId) {
        setAttribute(USERID, userId);
    }

    public void setUserName(String userName) {
        setAttribute(USERNAME, userName);
    }

    public String getUserName() {
        return (String) getAttribute(USERNAME);
    }

    public String getRemoteIp() {
        return remoteIp;
    }

    public void setRemoteIp(String remoteIp) {
        this.remoteIp = remoteIp;
    }

    public String getIndustrialid() {
        return (String) getAttribute(INDUSTRIALID);
    }

    public void setIndustrialid(String industrialid) {
        setAttribute(INDUSTRIALID, industrialid);
    }

    public String getUserOrgCode() {
        return (String) getAttribute(USERORGCODE);
    }

    public void setUserOrgCode(String userOrgCode) {
        setAttribute(USERORGCODE, userOrgCode);
    }

    public String getUserOrgName() {
        return (String) getAttribute(USERORGNAME);
    }

    public void setUserOrgName(String userOrgName) {
        setAttribute(USERORGNAME, userOrgName);
    }

    public String getSsDsjCode() {
        return (String) getAttribute(SSDSJCODE);
    }

    public void setSsDsjCode(String ssDsjCode) {
        setAttribute(SSDSJCODE, ssDsjCode);
    }

    public String getSsFsxCode() {
        return (String) getAttribute(SSFSXCODE);
    }

    public void setSsFsxCode(String ssFsxCode) {
        setAttribute(SSFSXCODE, ssFsxCode);
    }

    public String getSsPcsCode() {
        return (String) getAttribute(SSPCSCODE);
    }

    public void setSsPcsCode(String ssPcsCode) {
        setAttribute(SSPCSCODE, ssPcsCode);
    }
    
    public void set(String key, Object value){
        setAttribute(key, value);
    }
    
    public Object get(String key){
        return getAttribute(key);
    }

    public String getApiSchemeId() {
        return apiSchemeId;
    }

    public void setApiSchemeId(String apiSchemeId) {
        this.apiSchemeId = apiSchemeId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }
}
